package com.newtouch.bxzs.database.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.newtouch.bxzs.common.base.model.RoleMenuMap;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 角色菜单Mapper:
 *
 * <p>
 * <b>History:</b>
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2021/1/6 15:12</td>
 * <td>zhangqianyang</td>
 * <td>Create</td>
 * </tr>
 * </table>
 *
 * @author zhangqianyang
 * @version 1.0.0
 * @since 1.0.0
 */
@Mapper
public interface RoleMenuMapMapper extends BaseMapper<RoleMenuMap> {
    /**
     * 批量删除角色菜单中间表中的数据
     *
     * @param roleIdList 角色id
     */
    void deleteByRoleIdBatch(@Param("roleIdList") List<String> roleIdList);

    /**
     * 删除角色菜单中间表中的数据
     *
     * @param roleId 角色id
     */
    @Delete("DELETE FROM ASSISTANT_ROLE_MENU_MAP WHERE ROLE_ID = #{roleId}")
    void deleteByRoleId(@Param("roleId") String roleId);
}
